package cn.cau.epidemicsurveysystem.bean;

import javax.persistence.*;

/**
 * @projectName: gp2022
 * @package: cn.cau.epidemicsurveysystem.bean
 * @className: EpidTemplateOptionBean
 * @author: Eric
 * @description: TODO
 * @date: 2022/2/28 17:06
 * @version: 1.0
 */
@Entity
@Table(name = "epidTemplateOption", schema = "gp2022", catalog = "")
public class EpidTemplateOptionBean {
    private int epidTemplateOptionId;
    private String  optionValue;
    private Integer optionPos;
    private Integer epidTemplateQuestionId;

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "epidTemplateOptionId")
    public int getEpidTemplateOptionId() {
        return epidTemplateOptionId;
    }

    public void setEpidTemplateOptionId(int epidTemplateOptionId) {
        this.epidTemplateOptionId = epidTemplateOptionId;
    }

    @Basic
    @Column(name = "optionValue")
    public String getOptionValue() {
        return optionValue;
    }

    public void setOptionValue(String optionValue) {
        this.optionValue = optionValue;
    }

    @Basic
    @Column(name = "optionPos")
    public Integer getOptionPos() {
        return optionPos;
    }

    public void setOptionPos(Integer optionPos) {
        this.optionPos = optionPos;
    }

    @Basic
    @Column(name = "epidTemplateQuestionId")
    public Integer getEpidTemplateQuestionId() {
        return epidTemplateQuestionId;
    }

    public void setEpidTemplateQuestionId(Integer epidTemplateQuestionId) {
        this.epidTemplateQuestionId = epidTemplateQuestionId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        EpidTemplateOptionBean that = (EpidTemplateOptionBean) o;

        if (epidTemplateOptionId != that.epidTemplateOptionId) return false;
        if (optionValue != null ? !optionValue.equals(that.optionValue) : that.optionValue != null) return false;
        if (optionPos != null ? !optionPos.equals(that.optionPos) : that.optionPos != null) return false;
        if (epidTemplateQuestionId != null ? !epidTemplateQuestionId.equals(that.epidTemplateQuestionId) : that.epidTemplateQuestionId != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = epidTemplateOptionId;
        result = 31 * result + (optionValue != null ? optionValue.hashCode() : 0);
        result = 31 * result + (optionPos != null ? optionPos.hashCode() : 0);
        result = 31 * result + (epidTemplateQuestionId != null ? epidTemplateQuestionId.hashCode() : 0);
        return result;
    }
}
